package com.kai.steering.data.service.entity.domainObject;

import com.kai.steering.data.service.entity.dto.ClassificationQueryDTO;
import com.kai.steering.data.service.entity.po.Classification;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import java.util.Date;

import lombok.*;

import java.io.Serializable;

/**
 * <pre>
 * 题目分类 Do对象
 * </pre>
 *
 * @author kai
 * @date 2022-02-23
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
@ToString
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "ClassificationDO对象", description = "题目分类业务实体")
public class ClassificationDO implements Serializable {
    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "分类id")
    private String classificationId;
    @ApiModelProperty(value = "分类")
    private String classificationName;
    @ApiModelProperty(value = "分类信息")
    private String content;
    @ApiModelProperty(value = "管理员id或者用户id")
    private String founder;
    @ApiModelProperty(value = "创建时间")
    private Date creationDatetime;
    @ApiModelProperty(value = "存在0删除1")
    private Integer usable;
    @ApiModelProperty(value = "删除日期")
    private Date deleteDatetime;

    public ClassificationDO(String classificationId) {
        this.classificationId = classificationId;
    }

    public ClassificationDO(Classification classification) {
        this.classificationId = classification.getClassificationId();
        this.classificationName = classification.getClassificationName();
        this.content = classification.getContent();
        this.founder = classification.getFounder();
        this.creationDatetime = classification.getCreationDatetime();
        this.usable = classification.getUsable();
        this.deleteDatetime = classification.getDeleteDatetime();
    }

    public ClassificationDO(ClassificationQueryDTO classificationQueryDTO) {
        this.classificationId= classificationQueryDTO.getClassificationId();
        this.classificationName= classificationQueryDTO.getClassificationName();
        this.content= classificationQueryDTO.getContent();
        this.founder= classificationQueryDTO.getFounder();
        this.creationDatetime= null;

        this.deleteDatetime= null;
    }
}